#ifndef OBJECT_H
#define OBJECT_H

#include "color.h"
#include "vector3d.h"

class Object{
    public:
        Object(int = 0, int _type = 0, bool = true);
        Object(const Color &, int = 0, int _type = 0, bool = true);
        ~Object();

        int getId() const;
        void setId(int);

        const Color &getColor() const;
        void setColor(const Color &);

        bool isSelected() const;
        void select(bool);

        bool isPrimitive() const;
        int getType() const;

        void rotate(int, int, int);
        int getRotationX() const;
        int getRotationY() const;
        int getRotationZ() const;

        virtual double volume() const{return 0;};
        virtual double area() const{return 0;};

        virtual void draw(bool, bool = false, const Color & = Color(0.0, 0.0,0.0,0.0)) const = 0;
        virtual int classify(Vector3D *) const; //manda os 8 pontos da octree
        virtual void getMinMax(double *, double *, unsigned int) const = 0;

    protected:
        void setBoxPoints(const Vector3D &, const Vector3D &, Vector3D *) const;
        virtual void drawBox(bool, const Vector3D &, const Vector3D &, bool = false, const Color & = Color(0.0, 0.0,0.0,0.0)) const;

        double toRad(double) const;

        Color chooseColor(bool, bool, const Color&) const;

        int id;
        Color color;
        int type;
        bool primitive;
        bool selected;
        int rotationX;
        int rotationY;
        int rotationZ;
};

#endif

